﻿<%@ Page Language="VB" AutoEventWireup="false" CodeFile="create-user.aspx.vb" Inherits="create_user" MasterPageFile="~/page.master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mainContent" Runat="Server">
    <h1>Register new account</h1>
    <p>Sign Up for Your New Account</p>
    <div>
        <asp:CreateUserWizard ID="CreateUserWizard1" runat="server" 
            CreateUserButtonText="Submit" DisableCreatedUser="True" 
            FinishDestinationPageUrl="~/admin/Default.aspx" LoginCreatedUser="False">
            <CreateUserButtonStyle CssClass="btn" />
            <MailDefinition From="no-reply@acs-membership.com">
            </MailDefinition>
            <WizardSteps>
                <asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server" Title="">
                    <ContentTemplate>
                        <table>
                            <tr>
                                <td align="right">
                                    <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User Name:</asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox ID="UserName" runat="server"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName" 
                                        ErrorMessage="User Name is required." ToolTip="User Name is required." 
                                        ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="right">
                                    <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password" 
                                        ErrorMessage="Password is required." ToolTip="Password is required." 
                                        ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="right">
                                    <asp:Label ID="ConfirmPasswordLabel" runat="server" AssociatedControlID="ConfirmPassword">Confirm Password:</asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox ID="ConfirmPassword" runat="server" TextMode="Password"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="ConfirmPasswordRequired" runat="server" 
                                        ControlToValidate="ConfirmPassword" ErrorMessage="Confirm Password is required." 
                                        ToolTip="Confirm Password is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="right">
                                    <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email">E-mail:</asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox ID="Email" runat="server"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="Email" 
                                        ErrorMessage="E-mail is required." ToolTip="E-mail is required." 
                                        ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="right">
                                    <asp:Label ID="UniLabel" runat="server" AssociatedControlID="UniDropDownList">Institution</asp:Label>
                                </td>
                                <td>
                                    <asp:DropDownList ID="UniDropDownList" runat="server" AppendDataBoundItems="True" 
                                        DataSourceID="SqlDataSource2" DataTextField="UNIVERISTY_NAME" DataValueField="ID">
                                        <asp:ListItem></asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="UniDropDownList" 
                                        ErrorMessage="University" ToolTip="Security answer is required." 
                                        ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                                    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                                        ConnectionString="<%$ ConnectionStrings:ApplicationServices %>" 
                                        SelectCommand="SELECT * FROM [UNIVERSITIES]"></asp:SqlDataSource>
                                </td>
                            </tr>
                            <tr>
                                <td align="center" colspan="2">
                                    <asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password" 
                                        ControlToValidate="ConfirmPassword" Display="Dynamic" 
                                        ErrorMessage="The Password and Confirmation Password must match." 
                                        ValidationGroup="CreateUserWizard1"></asp:CompareValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="center" colspan="2" style="color:Red;">
                                    <asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal>
                                </td>
                            </tr>
                        </table>
                    </ContentTemplate>
                </asp:CreateUserWizardStep>
                <asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server">
                    <ContentTemplate>
                        <div class="alert alert-success">
                            <h4>Success!</h4>
                            Your account has been successfully created. An admin will have to approve you account before you can 
                            login. Please check your email for confirmation.<br />
                            <asp:Button ID="ContinueButton" runat="server" CausesValidation="False" CommandName="Continue" 
                                        Text="Continue" ValidationGroup="CreateUserWizard1" CssClass="btn" />
                        </div>
                    </ContentTemplate>
                </asp:CompleteWizardStep>
            </WizardSteps>
        </asp:CreateUserWizard>
    </div>
</asp:Content>